import {deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl} from '@/api/request'

export const application12 = {

    data() {
        return {
            url: {
                tab12Infor: "/api/ac/subsistence/ss02017Service/getApproveTab12Info",
            },
            Loading: false,
            familyInfo: {},
            disabled: true,
            formValidate: {},
            information: "",
            memberInformation: "",
            ss02017Id:"",
            yjab0015:""
        }
    },
    methods: {
        getFamilyInfor() {
            this.familyInfo = this.$parent.familyInfo;
        },
        getTab12Infor() {
            var that = this;
            postAction(that.url.tab12Infor, {
                ss12001Id: this.$parent.familyInfo.ss12001Id,
                type: 's17'
                // oldSs12001Id: this.$parent.familyInfo.oldSs12001Id
            }).then((res) => {
                if (res.data.errcode == 0) {
                    that.formValidate = res.data.data.ss12001;
                    that.information = res.data.data.information;
                    that.memberInformation = res.data.data.memberInformation;

                    that.label=that.formValidate.ssca0002=='203'?'是否入户调查：':'是否入户调查、民主评议、审批公示:';
                    if (that.formValidate.ssca0002 == '100' || that.formValidate.ssca0002 == '200' || that.formValidate.ssca0002 == '102' || that.formValidate.ssca0002 == '202') {
                        that.text = "总保障金额=差额保障金额+分类救助上浮总金额，不包括高龄补贴总金额";
                    } else {
                        that.text = "总保障金额=保障人口数*保障标准，不包括高龄补贴总金额";
                    }

                    //预警处置信息
                    if (that.formValidate.ssca0102) {
                        that.formValidate.ssca0102 = this.DateFormat(that.formValidate.ssca0102, 'YYYY-MM-DD');
                    }
                    if (that.formValidate.ssca0104) {
                        that.formValidate.ssca0104 = this.DateFormat(that.formValidate.ssca0104, 'YYYY-MM-DD');
                    }
                    //本户其他预警数据数量
                    that.ss02017Id=res.data.data.ss02017Id;
                    that.formValidate.ss02017Id=that.ss02017Id;
                    that.yjab0015=that.formValidate.ssca0107;
                    that.otherWarnCount=res.data.data.otherWarnCount;
                } else {
                    that.$Message.error(res.data.errmsg);
                }
            }).finally(() => {
                that.Loading = false;
            });
        },
        showOthers(){
            this.$refs.otherWarnModal.edit(this.ss02017Id,this.yjab0015);
        }
    }
}
